
#include "slide_average_filter.h"



/*!
    \brief      
    \param[in]  none
    \param[out] none
    \retval     none
*/

int16_t slideAverageFilter(int16_t value, STR_SLAVGE *hdl)
{
    int16_t result = 0;

    hdl->sum = hdl->sum - hdl->temp[hdl->cnt] + value;

    hdl->temp[hdl->cnt] = value;

    hdl->cnt++;
    hdl->cnt %= 64;

    result = hdl->sum >> 6;
	
	hdl->reslt = result;

    return result;
}

